package com.example.user.customviewdemo.draggridview;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.user.customviewdemo.R;

import java.util.ArrayList;

import butterknife.Bind;
import butterknife.ButterKnife;

public class DragGridViewActivity extends AppCompatActivity {

    @Bind(R.id.drag_gridview)
    DragGridView dragGridview;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drag_grid_view);
        ButterKnife.bind(this);
        GridViewAdapter adapter = new GridViewAdapter(this,getData());
        dragGridview.setAdapter(adapter);
    }

    public ArrayList<String> getData(){
        ArrayList<String> data = new ArrayList<>();
        for (int i = 0;i<10;i++){
            data.add("第"+i+"项");
        }
        return data;
    }
}
